package com.itheima.service.impl;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.itheima.domain.pojo.OperateLog;
import com.itheima.domain.query.QueryParam;
import com.itheima.domain.vo.PageResult;
import com.itheima.mapper.OperateLogMapper;
import com.itheima.service.OperateLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Author:篍
 * @Date: 2025/07/18 17:42
 * @Description:
 */
@Service
public class OperateLogServiceImpl implements OperateLogService {

    @Autowired
    OperateLogMapper operateLogMapper;

    @Override
    public PageResult<OperateLog> pageListLog(QueryParam queryParam) {
        PageHelper.startPage(queryParam.getPage(),queryParam.getPageSize());
        Page<OperateLog> operateLogPage=(Page<OperateLog>) operateLogMapper.pageListLog();
        return new PageResult<>(operateLogPage.getTotal(),operateLogPage.getResult());
    }
}
